home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / archiver / unix / unz50p1.zoo / Makefile < prev    next >
Makefile  |  1993-01-10  |  23KB  |  621 lines

  1. #==============================================================================
  2. # Makefile for UnZip, ZipInfo & FUnZip:  Unix, OS/2, MS-DOS ("real" makes only)
  3. # Version:  5.0 (inflate,explode)                                20 August 1992
  4. #==============================================================================
  5. #
  6. #
  7. # INSTRUCTIONS (such as they are):
  8. #
  9. # "make vax"    -- makes UnZip on a VAX 11-780 BSD 4.3 in current directory
  10. #           (or a SysV VAX, or an 8600 running Ultrix, or...)
  11. # "make"    -- uses environment variable SYSTEM to set the type
  12. #           system to compile for.  This doesn't work for some
  13. #           particularly brain-damaged versions of make (VAX BSD,
  14. #           Gould, and SCO Unix are in this group).  If SYSTEM not
  15. #           set, gives instructions on what to try instead.
  16. # "make list"    -- lists all supported systems (targets), including related
  17. #           utilities' targets
  18. # "make wombat" -- Chokes and dies if you haven't added the specifics
  19. #           for your Wombat 68000 (or whatever) to the systems list.
  20. #
  21. # CF are flags for the C compiler.  LF are flags for the loader.  LF2 are
  22. # more flags for the loader, if they need to be at the end of the line
  23. # instead of at the beginning (for example, some libraries).  LOCAL_UNZIP
  24. # is an environment variable that can be used to add default C flags to
  25. # your compile without editing the Makefile (e.g., -DDEBUG_STRUC, or -FPi87
  26. # on PCs).
  27. #
  28. # My host (a VAX 11-780 running BSD 4.3) is hereafter referred to as "my host."
  29. #
  30. # My host's /usr/include/sys/param.h defines BSD for me.  You may have to add
  31. # "-DBSD" to the list of CF for your system.
  32. #
  33. # Some versions of make do not define the macro "$(MAKE)" (my host did not).
  34. # The makefile should now handle such systems correctly, more or less; the
  35. # possible exception to this is if you've used a make command-line option
  36. # (for example, the one which displays the commands which WOULD be executed,
  37. # but doesn't actually execute them).  It probably needs some more tinkering.
  38. # If things still don't work, use "make" instead of "$(MAKE)" in your system's
  39. # makerule.  Or try adding the following line to your .login file:
  40. #   setenv MAKE "make"
  41. # (It didn't help on my host.)
  42. #
  43. # Memcpy and memset are provided for those systems that don't have them;
  44. # they're found in misc.c and will be used if -DZMEM is included in the list
  45. # of CF.  These days *almost* all systems have them (they're mandated by
  46. # ANSI), but older systems might be lacking.  And at least one machine's
  47. # version results in some serious performance degradation...
  48. #
  49. # Be sure to test your nice new UnZip; successful compilation does not always
  50. # imply a working program.
  51.  
  52.  
  53. #####################
  54. # MACRO DEFINITIONS #
  55. #####################
  56.  
  57. # Defaults most systems use (use LOCAL_UNZIP in environment to add flags, 
  58. # such as -DNOMEMCPY).
  59.  
  60. CRYPTF =
  61. CRYPTO =
  62. # Uncomment next two lines for decryption version:
  63. #CRYPTF = -DCRYPT
  64. #CRYPTO = crypt$O
  65.  
  66. # UnZip flags
  67. CC = cc#    try using "gcc" target rather than changing this (if you do,
  68. LD = cc#    you MUST change LD, too--else "unresolved symbol:  ___main")
  69. LOC = $(LOCAL_UNZIP) $(CRYPTF)
  70. CF = -O $(LOC)
  71. LF = -o unzip
  72. LF2 = -s
  73.  
  74. # ZipInfo flags
  75. ZC = -DZIPINFO
  76. ZL = -o zipinfo
  77. ZL2 = -s
  78.  
  79. # FUnZip flags
  80. FC = # not used
  81. FL = -o funzip
  82. FL2 = -s
  83.  
  84. # general-purpose stuff
  85. LN = rm -f misc_.c; ln
  86. RM = rm -f
  87. E =
  88. O = .o
  89. SHELL = /bin/sh
  90. INSTALL = cp#            probably can change this to 'install' if you have it
  91. BINDIR = /usr/local/bin#   target directory - where to install executables
  92.  
  93. # object files
  94. OBJS1 = unzip$O $(CRYPTO) envargs$O explode$O extract$O file_io$O inflate$O
  95. OBJS2 = mapname$O match$O misc$O unreduce$O unshrink$O
  96. OBJS = $(OBJS1) $(OBJS2)
  97. LOBJS = $(OBJS)
  98. OS2_OBJS = $(OBJS:.o=.obj) os2unzip.obj
  99. OBJZ = zipinfo$O envargs$O match$O misc_$O
  100. OS2_OBJZ = $(OBJZ:.o=.obj) os2zinfo.obj
  101. OBJF = funzip$O $(CRYPTO) inflate$O
  102. OS2_OBJF = # not yet supported
  103. UNZIPS = unzip$E # zipinfo$E funzip$E    # zipinfo, funzip not fully supported
  104. #                    #  yet (next release)
  105.  
  106. # list of supported systems/targets in this version
  107. SYSTEMS1 = 386i 3Bx 7300 amdahl apollo aviion bsd bull c120 c210 coherent
  108. SYSTEMS2 = convex cray cray_cc cray_v3 cyber_sgi dec dnix encore eta
  109. SYSTEMS3 = gcc gcc_dos generic generic2 gould hk68 hp indigo linux
  110. SYSTEMS4 = minix mips msc_dos next osf1 p_iris pyramid rs6000 rtaix
  111. SYSTEMS5 = sco sco_dos sco_x286 sequent sgi stellar sun sysv sysv6300
  112. SYSTEMS6 = tahoe ultrix vax wombat xos
  113.  
  114. SYS_UTIL1 = zi_dos zi_gcc zi_indigo zipinfo fu_gcc funzip
  115. # SYS_UTIL2 = ship ship_dos ship_sysv
  116.  
  117.  
  118. ####################
  119. # DEFAULT HANDLING #
  120. ####################
  121.  
  122. # The below will try to use your shell variable "SYSTEM" as the type system
  123. # to use (e.g., if you type "make" with no parameters at the command line).
  124. # The test for $(MAKE) is necessary for VAX BSD make (and Gould, apparently),
  125. # as is the "goober" (else stupid makes see an "else ;" statement, which they
  126. # don't like).  "goober" must then be made into a valid target for machines
  127. # which DO define MAKE properly (and have SYSTEM set).  Quel kludge, non?
  128. # And to top it all off, it appears that the VAX, at least, can't pick SYSTEM
  129. # out of the environment either (which, I suppose, should not be surprising).
  130. # [Btw, if the empty "goober" target causes someone else's make to barf, just
  131. # add an "@echo > /dev/null" command (or whatever).  Works OK on the Amdahl
  132. # and Crays, though.]
  133.  
  134. default:
  135.     @if test -z "$(MAKE)"; then\
  136.         if test -z "$(SYSTEM)";\
  137.         then make help;\
  138.         else make $(SYSTEM) MAKE="make";\
  139.         fi;\
  140.     else\
  141.         if test -z "$(SYSTEM)";\
  142.         then $(MAKE) help;\
  143.         else $(MAKE) $(SYSTEM) goober;\
  144.         fi;\
  145.     fi
  146.  
  147. goober:
  148.  
  149. help:
  150.     @echo
  151.     @echo\
  152.  "  If you're not sure about the characteristics of your system, try typing"
  153.     @echo\
  154.  '  "make generic".  If the compiler barfs and says something unpleasant about'
  155.     @echo\
  156.  '  "timezone redefined," try typing "make clean" followed by "make generic2".'
  157.     @echo\
  158.  '  One of these actions should produce a working copy of unzip on most Unix'
  159.     @echo\
  160.  '  systems.  If you know a bit more about the machine on which you work, you'
  161.     @echo\
  162.  '  might try "make list" for a list of the specific systems supported herein.'
  163.     @echo\
  164.  '  And as a last resort, feel free to read the numerous comments within the'
  165.     @echo\
  166.  '  Makefile itself.  Note that to compile the decryption version of UnZip,'
  167.     @echo\
  168.  '  you must obtain crypt.c separately, in addition to uncommenting two lines'
  169.     @echo\
  170.  '  in Makefile (see the main Contents file for ftp and mail-server sites).'
  171.     @echo\
  172.  '  Have an excruciatingly pleasant day.'
  173.     @echo
  174.  
  175. list:
  176.     @echo
  177.     @echo\
  178.  'Type "make <system>", where <system> is one of the following:'
  179.     @echo
  180.     @echo  "    $(SYSTEMS1)"
  181.     @echo  "    $(SYSTEMS2)"
  182.     @echo  "    $(SYSTEMS3)"
  183.     @echo  "    $(SYSTEMS4)"
  184.     @echo  "    $(SYSTEMS5)"
  185.     @echo  "    $(SYSTEMS6)"
  186.     @echo
  187.     @echo\
  188.  'Otherwise set the shell variable SYSTEM to one of these and just type "make".'
  189.     @echo\
  190.  'Targets for related utilities (ZipInfo) include:'
  191.     @echo
  192.     @echo  "    $(SYS_UTIL1)"
  193. #    @echo  "    $(SYS_UTIL2)"
  194.     @echo
  195.     @echo\
  196.  'For further (very useful) information, please read the comments in Makefile.'
  197.     @echo
  198.  
  199.  
  200. ###############################################
  201. # BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
  202. ###############################################
  203.  
  204. .c$O :
  205.     $(CC) -c $(CF) $*.c
  206.  
  207. unzips:        $(UNZIPS)
  208.  
  209. unzip$E:    $(OBJS)
  210.     $(LD) $(LF) $(LOBJS) $(LF2)
  211.  
  212. crypt$O:        crypt.c unzip.h zip.h    # may or may not be in distribution
  213. envargs$O:      envargs.c unzip.h
  214. explode$O:      explode.c unzip.h
  215. extract$O:      extract.c unzip.h
  216. file_io$O:      file_io.c unzip.h
  217. funzip$O:       funzip.c unzip.h
  218. inflate$O:      inflate.c unzip.h
  219. mapname$O:      mapname.c unzip.h
  220. match$O:        match.c unzip.h
  221. misc$O:         misc.c unzip.h
  222. os2unzip$O:     os2unzip.c unzip.h    # for OS/2 only
  223. os2zinfo$O:     os2unzip.c unzip.h    # for OS/2 only
  224. unreduce$O:     unreduce.c unzip.h
  225. unshrink$O:     unshrink.c unzip.h
  226. unzip$O:        unzip.c unzip.h
  227.  
  228. all:    generic_msg generic zipinfo
  229.  
  230. generic_msg:
  231.     @echo
  232.     @echo\
  233.  '  Attempting "make generic" and "make zipinfo" now.  If this fails for some'
  234.     @echo\
  235.  '  reason, type "make help" and/or "make list" for suggestions.'
  236.     @echo
  237.  
  238. install:    $(UNZIPS)
  239.     $(INSTALL) $(UNZIPS) $(BINDIR)
  240.  
  241. clean